/**********************************************************************************************************************
 * Copyright (c) Prophesee S.A.                                                                                       *
 *                                                                                                                    *
 * Licensed under the Apache License, Version 2.0 (the "License");                                                    *
 * you may not use this file except in compliance with the License.                                                   *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0                                 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed   *
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.                      *
 * See the License for the specific language governing permissions and limitations under the License.                 *
 **********************************************************************************************************************/

#include <pybind11/pybind11.h>

#include "metavision/sdk/ui/utils/ui_event.h"

namespace py = pybind11;

namespace Metavision {

void export_ui_events(py::module &m) {
    py::enum_<UIAction>(m, "UIAction", py::arithmetic())
        .value("RELEASE", UIAction::RELEASE)
        .value("PRESS", UIAction::PRESS)
        .value("REPEAT", UIAction::REPEAT)
        .export_values();

    py::enum_<UIMouseButton>(m, "UIMouseButton", py::arithmetic())
        .value("MOUSE_BUTTON_1", UIMouseButton::MOUSE_BUTTON_1)
        .value("MOUSE_BUTTON_2", UIMouseButton::MOUSE_BUTTON_2)
        .value("MOUSE_BUTTON_3", UIMouseButton::MOUSE_BUTTON_3)
        .value("MOUSE_BUTTON_4", UIMouseButton::MOUSE_BUTTON_4)
        .value("MOUSE_BUTTON_5", UIMouseButton::MOUSE_BUTTON_5)
        .value("MOUSE_BUTTON_6", UIMouseButton::MOUSE_BUTTON_6)
        .value("MOUSE_BUTTON_7", UIMouseButton::MOUSE_BUTTON_7)
        .value("MOUSE_BUTTON_8", UIMouseButton::MOUSE_BUTTON_8)
        .value("MOUSE_BUTTON_LAST", UIMouseButton::MOUSE_BUTTON_LAST)
        .value("MOUSE_BUTTON_LEFT", UIMouseButton::MOUSE_BUTTON_LEFT)
        .value("MOUSE_BUTTON_RIGHT", UIMouseButton::MOUSE_BUTTON_RIGHT)
        .value("MOUSE_BUTTON_MIDDLE", UIMouseButton::MOUSE_BUTTON_MIDDLE)
        .export_values();

    py::enum_<UIKeyEvent>(m, "UIKeyEvent", py::arithmetic())
        .value("KEY_UNKNOWN", UIKeyEvent::KEY_UNKNOWN)
        .value("KEY_SPACE", UIKeyEvent::KEY_SPACE)
        .value("KEY_APOSTROPHE", UIKeyEvent::KEY_APOSTROPHE)
        .value("KEY_COMMA", UIKeyEvent::KEY_COMMA)
        .value("KEY_MINUS", UIKeyEvent::KEY_MINUS)
        .value("KEY_PERIOD", UIKeyEvent::KEY_PERIOD)
        .value("KEY_SLASH", UIKeyEvent::KEY_SLASH)
        .value("KEY_0", UIKeyEvent::KEY_0)
        .value("KEY_1", UIKeyEvent::KEY_1)
        .value("KEY_2", UIKeyEvent::KEY_2)
        .value("KEY_3", UIKeyEvent::KEY_3)
        .value("KEY_4", UIKeyEvent::KEY_4)
        .value("KEY_5", UIKeyEvent::KEY_5)
        .value("KEY_6", UIKeyEvent::KEY_6)
        .value("KEY_7", UIKeyEvent::KEY_7)
        .value("KEY_8", UIKeyEvent::KEY_8)
        .value("KEY_9", UIKeyEvent::KEY_9)
        .value("KEY_SEMICOLON", UIKeyEvent::KEY_SEMICOLON)
        .value("KEY_EQUAL", UIKeyEvent::KEY_EQUAL)
        .value("KEY_A", UIKeyEvent::KEY_A)
        .value("KEY_B", UIKeyEvent::KEY_B)
        .value("KEY_C", UIKeyEvent::KEY_C)
        .value("KEY_D", UIKeyEvent::KEY_D)
        .value("KEY_E", UIKeyEvent::KEY_E)
        .value("KEY_F", UIKeyEvent::KEY_F)
        .value("KEY_G", UIKeyEvent::KEY_G)
        .value("KEY_H", UIKeyEvent::KEY_H)
        .value("KEY_I", UIKeyEvent::KEY_I)
        .value("KEY_J", UIKeyEvent::KEY_J)
        .value("KEY_K", UIKeyEvent::KEY_K)
        .value("KEY_L", UIKeyEvent::KEY_L)
        .value("KEY_M", UIKeyEvent::KEY_M)
        .value("KEY_N", UIKeyEvent::KEY_N)
        .value("KEY_O", UIKeyEvent::KEY_O)
        .value("KEY_P", UIKeyEvent::KEY_P)
        .value("KEY_Q", UIKeyEvent::KEY_Q)
        .value("KEY_R", UIKeyEvent::KEY_R)
        .value("KEY_S", UIKeyEvent::KEY_S)
        .value("KEY_T", UIKeyEvent::KEY_T)
        .value("KEY_U", UIKeyEvent::KEY_U)
        .value("KEY_V", UIKeyEvent::KEY_V)
        .value("KEY_W", UIKeyEvent::KEY_W)
        .value("KEY_X", UIKeyEvent::KEY_X)
        .value("KEY_Y", UIKeyEvent::KEY_Y)
        .value("KEY_Z", UIKeyEvent::KEY_Z)
        .value("KEY_LEFT_BRACKET", UIKeyEvent::KEY_LEFT_BRACKET)
        .value("KEY_BACKSLASH", UIKeyEvent::KEY_BACKSLASH)
        .value("KEY_RIGHT_BRACKET", UIKeyEvent::KEY_RIGHT_BRACKET)
        .value("KEY_GRAVE_ACCENT", UIKeyEvent::KEY_GRAVE_ACCENT)
        .value("KEY_WORLD_1", UIKeyEvent::KEY_WORLD_1)
        .value("KEY_WORLD_2", UIKeyEvent::KEY_WORLD_2)
        .value("KEY_ESCAPE", UIKeyEvent::KEY_ESCAPE)
        .value("KEY_ENTER", UIKeyEvent::KEY_ENTER)
        .value("KEY_TAB", UIKeyEvent::KEY_TAB)
        .value("KEY_BACKSPACE", UIKeyEvent::KEY_BACKSPACE)
        .value("KEY_INSERT", UIKeyEvent::KEY_INSERT)
        .value("KEY_DELETE", UIKeyEvent::KEY_DELETE)
        .value("KEY_RIGHT", UIKeyEvent::KEY_RIGHT)
        .value("KEY_LEFT", UIKeyEvent::KEY_LEFT)
        .value("KEY_DOWN", UIKeyEvent::KEY_DOWN)
        .value("KEY_UP", UIKeyEvent::KEY_UP)
        .value("KEY_PAGE_UP", UIKeyEvent::KEY_PAGE_UP)
        .value("KEY_PAGE_DOWN", UIKeyEvent::KEY_PAGE_DOWN)
        .value("KEY_HOME", UIKeyEvent::KEY_HOME)
        .value("KEY_END", UIKeyEvent::KEY_END)
        .value("KEY_CAPS_LOCK", UIKeyEvent::KEY_CAPS_LOCK)
        .value("KEY_SCROLL_LOCK", UIKeyEvent::KEY_SCROLL_LOCK)
        .value("KEY_NUM_LOCK", UIKeyEvent::KEY_NUM_LOCK)
        .value("KEY_PRINT_SCREEN", UIKeyEvent::KEY_PRINT_SCREEN)
        .value("KEY_PAUSE", UIKeyEvent::KEY_PAUSE)
        .value("KEY_F1", UIKeyEvent::KEY_F1)
        .value("KEY_F2", UIKeyEvent::KEY_F2)
        .value("KEY_F3", UIKeyEvent::KEY_F3)
        .value("KEY_F4", UIKeyEvent::KEY_F4)
        .value("KEY_F5", UIKeyEvent::KEY_F5)
        .value("KEY_F6", UIKeyEvent::KEY_F6)
        .value("KEY_F7", UIKeyEvent::KEY_F7)
        .value("KEY_F8", UIKeyEvent::KEY_F8)
        .value("KEY_F9", UIKeyEvent::KEY_F9)
        .value("KEY_F10", UIKeyEvent::KEY_F10)
        .value("KEY_F11", UIKeyEvent::KEY_F11)
        .value("KEY_F12", UIKeyEvent::KEY_F12)
        .value("KEY_F13", UIKeyEvent::KEY_F13)
        .value("KEY_F14", UIKeyEvent::KEY_F14)
        .value("KEY_F15", UIKeyEvent::KEY_F15)
        .value("KEY_F16", UIKeyEvent::KEY_F16)
        .value("KEY_F17", UIKeyEvent::KEY_F17)
        .value("KEY_F18", UIKeyEvent::KEY_F18)
        .value("KEY_F19", UIKeyEvent::KEY_F19)
        .value("KEY_F20", UIKeyEvent::KEY_F20)
        .value("KEY_F21", UIKeyEvent::KEY_F21)
        .value("KEY_F22", UIKeyEvent::KEY_F22)
        .value("KEY_F23", UIKeyEvent::KEY_F23)
        .value("KEY_F24", UIKeyEvent::KEY_F24)
        .value("KEY_F25", UIKeyEvent::KEY_F25)
        .value("KEY_KP_0", UIKeyEvent::KEY_KP_0)
        .value("KEY_KP_1", UIKeyEvent::KEY_KP_1)
        .value("KEY_KP_2", UIKeyEvent::KEY_KP_2)
        .value("KEY_KP_3", UIKeyEvent::KEY_KP_3)
        .value("KEY_KP_4", UIKeyEvent::KEY_KP_4)
        .value("KEY_KP_5", UIKeyEvent::KEY_KP_5)
        .value("KEY_KP_6", UIKeyEvent::KEY_KP_6)
        .value("KEY_KP_7", UIKeyEvent::KEY_KP_7)
        .value("KEY_KP_8", UIKeyEvent::KEY_KP_8)
        .value("KEY_KP_9", UIKeyEvent::KEY_KP_9)
        .value("KEY_KP_DECIMAL", UIKeyEvent::KEY_KP_DECIMAL)
        .value("KEY_KP_DIVIDE", UIKeyEvent::KEY_KP_DIVIDE)
        .value("KEY_KP_MULTIPLY", UIKeyEvent::KEY_KP_MULTIPLY)
        .value("KEY_KP_SUBTRACT", UIKeyEvent::KEY_KP_SUBTRACT)
        .value("KEY_KP_ADD", UIKeyEvent::KEY_KP_ADD)
        .value("KEY_KP_ENTER", UIKeyEvent::KEY_KP_ENTER)
        .value("KEY_KP_EQUAL", UIKeyEvent::KEY_KP_EQUAL)
        .value("KEY_LEFT_SHIFT", UIKeyEvent::KEY_LEFT_SHIFT)
        .value("KEY_LEFT_CONTROL", UIKeyEvent::KEY_LEFT_CONTROL)
        .value("KEY_LEFT_ALT", UIKeyEvent::KEY_LEFT_ALT)
        .value("KEY_LEFT_SUPER", UIKeyEvent::KEY_LEFT_SUPER)
        .value("KEY_RIGHT_SHIFT", UIKeyEvent::KEY_RIGHT_SHIFT)
        .value("KEY_RIGHT_CONTROL", UIKeyEvent::KEY_RIGHT_CONTROL)
        .value("KEY_RIGHT_ALT", UIKeyEvent::KEY_RIGHT_ALT)
        .value("KEY_RIGHT_SUPER", UIKeyEvent::KEY_RIGHT_SUPER)
        .value("KEY_MENU", UIKeyEvent::KEY_MENU)
        .value("KEY_LAST", UIKeyEvent::KEY_LAST)
        .export_values();
}

} // namespace Metavision